﻿<UserControl x:Class="DeltaGroup.WheelOfJeopardy.UI.Controls.Wheel"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:local="clr-namespace:DeltaGroup.WheelOfJeopardy.UI.Controls" 
    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
	mc:Ignorable="d"
	x:Name="ucWheel"
	d:DesignWidth="450" d:DesignHeight="450">

    <UserControl.Resources>

        <Storyboard x:Key="spinWheelStoryboard" Completed="Storyboard_Completed">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="WheelCanvas">
            	<SplineDoubleKeyFrame KeyTime="0:0:2" Value="720" KeySpline="0.09,1,0.74,0.99"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

    </UserControl.Resources>

    <Canvas x:Name="LayoutRoot">
        <Canvas x:Name="WheelCanvas" Width="450" Height="450" RenderTransformOrigin="0.5,0.5">
            <Canvas.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="{Binding ElementName=ucWheel, Path=RotateTransformAngle}"/>
                    <TranslateTransform/>
                </TransformGroup>
            </Canvas.RenderTransform>
            <Canvas x:Name="WheelSectors" Height="400" Width="400" Canvas.Left="25" Canvas.Top="25">              
            </Canvas>

        </Canvas>
        <ed:RegularPolygon Fill="#FFF98330" Height="35" InnerRadius="1" Canvas.Left="160" PointCount="3" Stretch="Fill" Stroke="Black" Width="130" RenderTransformOrigin="0.5,0.5" Canvas.Top="1">
            <ed:RegularPolygon.RenderTransform>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform Angle="180"/>
                    <TranslateTransform/>
                </TransformGroup>
            </ed:RegularPolygon.RenderTransform>
        </ed:RegularPolygon>
        <TextBlock Canvas.Left="160" Canvas.Top="5" Height="25" Name="continueLink" Text="Continue" FontWeight="Bold" Visibility="Hidden" Foreground="Blue" Width="130" TextAlignment="Center" MouseUp="ContinueSelected" KeyUp="ContinueSelected" />
    </Canvas>
</UserControl>
